﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace AMStudio.Driver
{
    [Serializable]
    public class RobotPoint : ICloneable
    {
        public RobotPoint()
        {
        }

        public RobotPoint(uint nomber, float x, float y, float z, float r)
            : this(nomber, x, y, z, r, 0, 0, string.Empty)
        {
        }

        public RobotPoint(uint nomber, float x, float y, float z, float r, float a, float b)
            : this(nomber, x, y, z, r, 0, 0, string.Empty)
        {
        }

        public RobotPoint(uint nomber, float x, float y, float z, float r, string note)
            : this(nomber, x, y, z, r, 0, 0, note)
        {
        }

        public RobotPoint(uint nomber, float x, float y, float z, float r, float a, float b, string note)
        {
            this.Number = nomber;
            this.X = x;
            this.Y = y;
            this.Z = z;
            this.R = r;
            this.A = a;
            this.B = b;
            this.Note = note;
        }

        private uint nomber;
        public uint Number
        {
            get { return nomber; }
            set { nomber = value; }
        }

        private float x;
        public float X
        {
            get { return x; }
            set { x = value; }
        }

        private float y;
        public float Y
        {
            get { return y; }
            set { y = value; }
        }

        private float z;
        public float Z
        {
            get { return z; }
            set { z = value; }
        }

        private float r;
        public float R
        {
            get { return r; }
            set { r = value; }
        }

        private float a;
        public float A
        {
            get { return a; }
            set { a = value; }
        }

        private float b;
        public float B
        {
            get { return b; }
            set { b = value; }
        }

        private int armType = 0;
        public int ArmType
        {
            get { return armType; }
            set { armType = value; }
        }

        private string note = string.Empty;
        public string Note
        {
            get { return note; }
            set { note = value; }
        }

        public override string ToString()
        {
            return ("P" + this.Number.ToString() + "="
                + this.X.ToString() + " "
                + this.Y.ToString() + " "
                + this.Z.ToString() + " "
                + this.R.ToString() + " "
                + this.A.ToString() + " "
                + this.B.ToString() + " "
                + this.Note).Trim();
        }

        object ICloneable.Clone()
        {
            return this.Clone();
        }

        public RobotPoint Clone()
        {
            return (RobotPoint)this.MemberwiseClone();
        }

    }
}
